package com.cjm.one.webmanager.service.goods.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.goods.client.GoodsSpecClient;
import com.cjm.one.model.goods.entity.GoodsSpec;
import com.cjm.one.webmanager.service.goods.GoodsSpecService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsSpecImpl implements GoodsSpecService{
    @Resource
    private GoodsSpecClient goodsSpecClient;
    @Override
    public Page<GoodsSpec> listPage(Long current, Long size, String specName) {
        return goodsSpecClient.list(current,size,specName).getData();
    }

    @Override
    public GoodsSpec getById(Long id) {
        return goodsSpecClient.getById(id).getData();
    }

    @Override
    public List<GoodsSpec> getAllList() {
        return goodsSpecClient.all().getData();
    }

    @Override
    public Boolean save(GoodsSpec goodsSpec) {
        return goodsSpecClient.add(goodsSpec).getData();
    }

    @Override
    public Boolean updateById(GoodsSpec goodsSpec) {
        return goodsSpecClient.update(goodsSpec).getData();
    }

    @Override
    public Boolean removeById(Long id) {
        return goodsSpecClient.delete(id).getData();
    }


}
